
 <html><head><title>Resource Actions for the Fujitsu Global Cloud Platform (FGCP)</title></head><body><h1>Resource Actions for the Fujitsu Global Cloud Platform (FGCP)</h1><p><strong>The following list gives an overview of the resource actions supported by this client API library that can be used in your scripts. This list is likely to be extended in future releases, and any suggestions are welcome in the <a href="http://code.google.com/p/fgcp-client-api/issues/list" rel="nofollow">issue tracker</a>.</strong> </p><pre class="prettyprint">Example: [see tests/test_resource.py for more examples]

# Connect with your client certificate to region &#x27;uk&#x27;
from fgcp.resource import FGCPVDataCenter
vdc = FGCPVDataCenter(&#x27;client.pem&#x27;, &#x27;uk&#x27;)

# Do typical resource actions
vsystem = vdc.get_vsystem(&#x27;Python API Demo System&#x27;)
vsystem.show_status()
for vserver in vsystem.vservers:
    result = vserver.backup(wait=True)
...</pre><p><ul><li><a href="#Resource_Actions_for_the_Fujitsu_Global_Cloud_Platform_(FGCP)">Resource Actions for the Fujitsu Global Cloud Platform (FGCP)</a></li><ul><li><a href="#FGCPVDataCenter">FGCPVDataCenter</a></li><li><a href="#FGCPVSystem">FGCPVSystem</a></li><li><a href="#FGCPVServer">FGCPVServer</a></li><li><a href="#FGCPVDisk">FGCPVDisk</a></li><li><a href="#FGCPBackup">FGCPBackup</a></li><li><a href="#FGCPFirewall">FGCPFirewall</a></li><li><a href="#FGCPLoadBalancer">FGCPLoadBalancer</a></li><li><a href="#FGCPPublicIP">FGCPPublicIP</a></li><li><a href="#FGCPAddressRange">FGCPAddressRange</a></li><li><a href="#FGCPVSysDescriptor">FGCPVSysDescriptor</a></li><li><a href="#FGCPDiskImage">FGCPDiskImage</a></li><li><a href="#FGCPServerType">FGCPServerType</a></li><li><a href="#FGCPDesign">FGCPDesign</a></li></ul></ul> </p><p>Note: this client API library also provides higher-level <a href="ClientMethods.html">Client Methods</a> and lower-level <a href="APICommands.html">API Commands</a>. </p><hr/><h2><a name="FGCPVDataCenter"></a>FGCPVDataCenter<a href="#FGCPVDataCenter" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_vdatacenter_yuml.png" /> </p><pre class="prettyprint">    from fgcp.resource import FGCPVDataCenter
    vdc = FGCPVDataCenter(key_file=&#x27;client.pem&#x27;, region=&#x27;de&#x27;, verbose=0, debug=0)

    status = vdc.status()
    #vdc.show_vsystem_status()

    date, usagelist = vdc.get_vsystem_usage(vsysNames=None)
    #vdc.show_vsystem_usage(vsysNames=None)

    vsystems = vdc.list_vsystems()
    #vsystem = vdc.get_vsystem(&#x27;Python API Demo System&#x27;)
    vsystem = vdc.get_vsystem(&#x27;Demo System&#x27;)
    test_vsystem(vsystem)

    #vsysId = vdc.create_vsystem(&#x27;Python API Demo System&#x27;, &#x27;2-tier Skeleton&#x27;, wait=True)
    #result = vdc.destroy_vsystem(&#x27;Python API Demo System&#x27;, wait=True)

    publicips = vdc.list_publicips()
    publicip = vdc.get_publicip(publicips[0].address)
    test_publicip(publicip)

    addressranges = vdc.list_addressranges()
    #result = vdc.create_addresspool(pipFrom=None, pipTo=None)
    #result = vdc.add_addressrange(pipFrom, pipTo)
    #result = vdc.delete_addressrange(pipFrom, pipTo)

    vsysdescriptors = vdc.list_vsysdescriptors()
    vsysdescriptor = vdc.get_vsysdescriptor(&#x27;2-tier Skeleton&#x27;)
    test_vsysdescriptor(vsysdescriptor)

    diskimages = vdc.list_diskimages()
    diskimages = vdc.list_diskimages(vsysdescriptor)
    diskimage = vdc.get_diskimage(&#x27;CentOS 5.4 32bit(EN)&#x27;)
    test_diskimage(diskimage)

    servertypes = vdc.list_servertypes()
    servertypes = vdc.list_servertypes(diskimage)
    servertype = vdc.get_servertype(&#x27;economy&#x27;)
    test_servertype(servertype)

    design = vdc.get_vsystem_design(&#x27;Demo System&#x27;)
    test_design(design)</pre><hr/><h2><a name="FGCPVSystem"></a>FGCPVSystem<a href="#FGCPVSystem" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_vsystem_yuml.png" /> </p><pre class="prettyprint">    #vsystem = vdc.get_vsystem(&#x27;Python API Demo System&#x27;)

    status = vsystem.status()

    date, usage = vsystem.get_usage()

    info = vsystem.get_status()
    vsystem.show_status()

    #result = vsystem.start(wait=True)
    #result = vsystem.stop(wait=True, force=None)

    #result = vsystem.update(vsysName=&#x27;New Demo System&#x27;, cloudCategory=&#x27;PUBLIC&#x27;)

    inventory = vsystem.get_inventory()

    vservers = vsystem.list_vservers()
    for vserver in vsystem.vservers:
        pass
    #vserver = vsystem.get_vserver(&#x27;Server1&#x27;)
    vserver = vsystem.get_vserver(&#x27;DB1&#x27;)
    test_vserver(vserver)

    #vserverId = vsystem.create_vserver(&#x27;My New Server&#x27;, &#x27;economy&#x27;, &#x27;CentOS 5.4 32bit(EN)&#x27;, &#x27;DMZ&#x27;)
    #result = vsystem.start_vserver(&#x27;My New Server&#x27;, wait=True)
    #result = vsystem.stop_vserver(&#x27;My New Server&#x27;, wait=True)
    #result = vsystem.destroy_vserver(&#x27;My New Server&#x27;, wait=True)

    vdisks = vsystem.list_vdisks()
    for vdisk in vsystem.vdisks:
        pass
    vdisk = vsystem.get_vdisk(&#x27;DISK1&#x27;)
    test_vdisk(vdisk)
    #result = vsystem.create_vdisk(&#x27;DISK2&#x27;, size=1500, wait=True)
    #result = vsystem.attach_vdisk(&#x27;DISK2&#x27;, &#x27;My New Server&#x27;, wait=True)
    #result = vsystem.detach_vdisk(&#x27;DISK2&#x27;, &#x27;My New Server&#x27;, wait=True)
    #result = vsystem.destroy_vdisk(&#x27;DISK2&#x27;, wait=True)

    test_vserver_vdisk(vserver, vdisk)

    firewalls = vsystem.list_firewalls()
    for firewall in vsystem.firewalls:
        pass
    firewall = vsystem.get_firewall(&#x27;Firewall&#x27;)
    test_firewall(firewall)

    loadbalancers = vsystem.list_loadbalancers()
    for loadbalancer in vsystem.loadbalancers:
        pass
    loadbalancer = vsystem.get_loadbalancer(&#x27;SLB1&#x27;)
    test_loadbalancer(loadbalancer)
    #result = vsystem.create_loadbalancer(&#x27;SLB2&#x27;, &#x27;DMZ&#x27;, wait=True)

    publicips = vsystem.list_publicips()
    for publicip in vsystem.publicips:
        pass
    publicip = vsystem.get_publicip(publicips[0].address)
    test_publicip(publicip)
    #result = vsystem.allocate_publicip(wait=True)

    vnets = vsystem.list_vnets()
    for vnet in vsystem.vnets:
        pass

    console = vsystem.get_console_url(vnets[0])

    #vsystem.vsysName = &#x27;Copy of %s&#x27; % vsystem.vsysName
    #result = vsystem.create()

    #result = vsystem.detroy(wait=True)</pre><hr/><h2><a name="FGCPVServer"></a>FGCPVServer<a href="#FGCPVServer" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_vserver_yuml.png" /> </p><pre class="prettyprint">    #vserver = vsystem.get_vserver(&#x27;WepApp1&#x27;)

    status = vserver.status()

    #result = vserver.start(wait=True)
    #result = vserver.stop(wait=True, force=None)

    #result = vserver.update(vserverName=&#x27;New Server&#x27;, vserverType=&#x27;economy&#x27;)

    config = vserver.get_configuration()
    vdisks = vserver.list_vdisks()
    for vdisk in vdisks:
        test_vdisk(vdisk)
        break
    #result = vserver.attach_vdisk(vdisk)
    #result = vserver.detach_vdisk(vdisk)

    vnics = vserver.list_vnics()
    for vnic in vnics:
        test_vnic(vnic)
        break

    backups = vserver.list_backups(timeZone=None, countryCode=None)
    for backup in backups:
        test_backup(backup)
        break
    #result = vserver.backup(wait=True)

    initialpwd = vserver.get_password()

    #vserver.vserverName = &#x27;Copy of %s&#x27; % vserver.vserverName
    #result = vserver.create()

    #result = vserver.detroy(wait=True)</pre><hr/><h2><a name="FGCPVDisk"></a>FGCPVDisk<a href="#FGCPVDisk" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_vdisk_yuml.png" /> </p><pre class="prettyprint">    status = vdisk.status()

    backups = vdisk.list_backups(timeZone=None, countryCode=None)
    for backup in backups:
        test_backup(backup)
        break
    #result = vdisk.backup(wait=True)

    #result = vdisk.update(vdiskName=&#x27;New Disk&#x27;)

    #result = vdisk.attach(vserver)
    #result = vdisk.detach(vserver)

    #vdisk.vdiskName = &#x27;Copy of %s&#x27; % vdisk.vdiskName
    #result = vdisk.create()

    #result = vdisk.detroy(wait=True)</pre><hr/><h2><a name="FGCPBackup"></a>FGCPBackup<a href="#FGCPBackup" class="section_anchor"></a></h2><pre class="prettyprint">    #backup.restore(wait=True)
    #backup.destroy()</pre><hr/><h2><a name="FGCPFirewall"></a>FGCPFirewall<a href="#FGCPFirewall" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_firewall_yuml.png" /> </p><pre class="prettyprint">    status = firewall.status()
    #result = firewall.start(wait=True)
    #result = firewall.stop(wait=True)

    #efmName = firewall.efmName
    #result = firewall.update(efmName=efmName)

    backups = firewall.list_backups(timeZone=None, countryCode=None)
    #result = firewall.backup(wait=True)

    nat_rules = firewall.get_nat_rules()
    #result = firewall.set_nat_rules(rules=nat_rules)

    dns = firewall.get_dns()
    #result = firewall.set_dns(dnstype=&#x27;AUTO&#x27;, primary=None, secondary=None)

    policies = firewall.get_policies(from_zone=None, to_zone=None)
    #result = firewall.set_policies(log=&#x27;On&#x27;, policies=policies)

    logs = firewall.get_log(num=10, orders=None)

    limit_policies = firewall.get_limit_policies(from_zone=None, to_zone=None)

    update_info = firewall.get_update_info()
    #result = firewall.apply_update()
    #result = firewall.revert_update()</pre><hr/><h2><a name="FGCPLoadBalancer"></a>FGCPLoadBalancer<a href="#FGCPLoadBalancer" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_loadbalancer_yuml.png" /> </p><pre class="prettyprint">    status = loadbalancer.status()

    #result = loadbalancer.start(wait=True)
    #result = loadbalancer.stop(wait=True)

    #efmName = loadbalancer.efmName
    #result = loadbalancer.update(efmName=efmName)

    backups = loadbalancer.list_backups(timeZone=None, countryCode=None)
    for backup in backups:
        test_backup(backup)
        break
    #result = loadbalancer.backup(wait=True)

    rules = loadbalancer.get_rules()
    #result = loadbalancer.set_rules(groups=rules.groups, force=None, webAccelerator=None)
    #vserver1 = vsystem.get_vserver(&#x27;WebApp1&#x27;)
    #vserver2 = vsystem.get_vserver(&#x27;WebApp2&#x27;)
    #loadbalancer.add_group(id=10, protocol=&#x27;http&#x27;, targets=[vserver1, vserver2])
    #loadbalancer.delete_group(id=20)

    load_stats = loadbalancer.get_load_stats()
    #result = loadbalancer.clear_load_stats()
    error_stats = loadbalancer.get_error_stats()
    #result = loadbalancer.clear_error_stats()

    servercerts = loadbalancer.list_servercerts(detail=None)
    #result = loadbalancer.add_cert(certNum=5, filePath=&quot;server.pfx&quot;, passphrase=&#x27;changeit&#x27;)
    #result = loadbalancer.set_cert(certNum=5, groupId=10)
    #result = loadbalancer.release_cert(certNum=10)
    #result = loadbalancer.delete_cert(certNum=10, force=None)
    ccacerts = loadbalancer.list_ccacerts(detail=None)
    #result = loadbalancer.add_cca(ccacertNum=101, filePath=&#x27;cacert.crt&#x27;)
    #result = loadbalancer.delete_cca(ccacertNum=101)
    cert_list = loadbalancer.get_cert_list(certCategory=None, detail=None)

    #result = loadbalancer.start_maintenance(groupId=10, ipAddress=&#x27;192.168.0.13&#x27;, time=None, unit=None)
    #result = loadbalancer.stop_maintenance(groupId=10, ipAddress=&#x27;192.168.0.13&#x27;)

    update_info = loadbalancer.get_update_info()
    #result = loadbalancer.apply_update()
    #result = loadbalancer.revert_update()

    #result = loadbalancer.detroy()</pre><hr/><h2><a name="FGCPPublicIP"></a>FGCPPublicIP<a href="#FGCPPublicIP" class="section_anchor"></a></h2><pre class="prettyprint">    status = publicip.status()
    #result = publicip.attach(wait=True)
    #result = publicip.detach(wait=True)
    #result = publicip.free(wait=True)</pre><hr/><h2><a name="FGCPAddressRange"></a>FGCPAddressRange<a href="#FGCPAddressRange" class="section_anchor"></a></h2><pre class="prettyprint"></pre><hr/><h2><a name="FGCPVSysDescriptor"></a>FGCPVSysDescriptor<a href="#FGCPVSysDescriptor" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_vsysdescriptor_yuml.png" /> </p><pre class="prettyprint">    diskimages = vsysdescriptor.list_diskimages()
    #vsysId = vsysdescriptor.create_vsystem(&#x27;Python API Demo System&#x27;, wait=True)

    #vsysdescriptor.update(vsysdescriptorName=&#x27;New VSYSDescriptor&#x27;,
	#	description=&#x27;This is a new vsysdescriptor&#x27;, keyword=&#x27;2-tier Skeleton&#x27;)</pre><hr/><h2><a name="FGCPDiskImage"></a>FGCPDiskImage<a href="#FGCPDiskImage" class="section_anchor"></a></h2><p><img src="http://mikespub.net/fgcp_diskimage_yuml.png" /> </p><pre class="prettyprint">    softwares = diskimage.list_softwares()
    servertypes = diskimage.list_servertypes()

    #diskimage.update(diskimageName=&#x27;New Disk Image&#x27;, description=&#x27;This is a new disk image&#x27;)</pre><hr/><h2><a name="FGCPServerType"></a>FGCPServerType<a href="#FGCPServerType" class="section_anchor"></a></h2><pre class="prettyprint"></pre><hr/><h2><a name="FGCPDesign"></a>FGCPDesign<a href="#FGCPDesign" class="section_anchor"></a></h2><pre class="prettyprint">    #design = vdc.get_vsystem_design()

    #vsystem = design.load_file(&#x27;fgcp_demo_system.txt&#x27;)
    vsystem = design.load_vsystem(&#x27;Demo System&#x27;)
    #result = design.build_vsystem(&#x27;My New VSystem&#x27;)
    design.save_file(&#x27;new_demo_system.txt&#x27;)
    design.load_file(&#x27;new_demo_system.txt&#x27;)</pre><p>Note: this client API library also provides higher-level <a href="ClientMethods.html">Client Methods</a> and lower-level <a href="APICommands.html">API Commands</a>. </p>
 <p>Content: <a href="index.html">index</a>&nbsp;&nbsp;<a href="ClientMethods.html">ClientMethods</a>&nbsp;&nbsp;<a href="ResourceActions.html">ResourceActions</a>&nbsp;&nbsp;<a href="APICommands.html">APICommands</a>&nbsp;&nbsp;<a href="ClassDiagrams.html">ClassDiagrams</a>&nbsp;&nbsp;<a href="TestServer.html">TestServer</a>&nbsp;&nbsp;<a href="RelayServer.html">RelayServer</a>&nbsp;&nbsp;<a href="fgcp.html">pydoc fgcp</a>&nbsp;&nbsp;<a href="tests.html">pydoc tests</a></p></body></html>